/<template>
  <div>
    <p @click="$router.go(-1)">back</p>>
    {{
        $route.params.id
    }}
     <van-card
        v-for="(item, index) in details_data"
        :key="index"
        num="2"
        price="2.00"
        :title="item.title"
        :thumb="item.img"
    />
  </div>
</template>

<script>
import {mapState} from "vuex"
export default {
    name:"Details",
    data(){
        return {
            details_data:[]
        }
    },
    created(){
        this.filter_data()
    },
    computed:{ 
        ...mapState(["children_list"])
      
    },
    methods:{
        filter_data(){
            this.details_data = this.children_list.filter(item=>item.id ===this.$route.params.id)
            console.log(this.children_list.filter(item=>item.id ===this.$route.params.id)); 
        }
    }
    
}
</script>

<style>

</style>